#ifndef REDISMGR_H
#define REDISMGR_H

#include <QObject>
#include<QStringList>
#include<iostream>
#include"hiredis.h"

class RedisMgr : public QObject
{
    Q_OBJECT
public:
    explicit RedisMgr(QObject *parent = 0);
    static RedisMgr& getInstance();
    bool Connect(const std::string& host, int port);
    bool Auth(const std::string& password);
    bool SAdd(const std::string& key, const std::string& value);
    bool SREM(const std::string& key, const std::string& value);
    QStringList SMember(const std::string& key);
    bool Del(const std::string& key);

signals:

public slots:
private:
    redisContext* _connect;
    redisReply* _reply;
};

#endif // REDISMGR_H
